home *** CD-ROM | disk | FTP | other *** search
Unknown | 1999-09-27 | 6.6 KB |
view JSON data
|
view as text
|
open on a Mac
|
open on a PC
This file was not able to be converted.
This format is not currently supported by dexvert.
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| file
| data
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 00 00 00 00 00 00 00 | 5e 69 2f 2f 3d 3d 3d 3d |........|^i//====|
|00000010| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000020| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000030| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000040| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000050| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 0d 0a 2f 2f 20 55 64 |========|=..// Ud|
|00000060| 70 53 65 72 76 65 72 55 | 70 6c 69 6e 6b 0d 0a 2f |pServerU|plink../|
|00000070| 2f 0d 0a 2f 2f 20 56 65 | 72 73 69 6f 6e 3a 20 31 |/..// Ve|rsion: 1|
|00000080| 2e 33 0d 0a 2f 2f 0d 0a | 2f 2f 20 54 68 69 73 20 |.3..//..|// This |
|00000090| 75 70 6c 69 6e 6b 20 69 | 73 20 63 6f 6d 70 6c 69 |uplink i|s compli|
|000000a0| 61 6e 74 20 77 69 74 68 | 20 74 68 65 20 47 61 6d |ant with| the Gam|
|000000b0| 65 53 70 79 20 55 70 6c | 69 6e 6b 20 53 70 65 63 |eSpy Upl|ink Spec|
|000000c0| 69 66 69 63 61 74 69 6f | 6e 2e 0d 0a 2f 2f 20 54 |ificatio|n...// T|
|000000d0| 68 65 20 73 70 65 63 69 | 66 69 63 61 74 69 6f 6e |he speci|fication|
|000000e0| 20 69 73 20 61 76 61 69 | 6c 61 62 6c 65 20 61 74 | is avai|lable at|
|000000f0| 20 68 74 74 70 3a 2f 2f | 77 77 77 2e 67 61 6d 65 | http://|www.game|
|00000100| 73 70 79 2e 63 6f 6d 2f | 64 65 76 65 6c 6f 70 65 |spy.com/|develope|
|00000110| 72 0d 0a 2f 2f 20 61 6e | 64 20 6d 69 67 68 74 20 |r..// an|d might |
|00000120| 62 65 20 6f 66 20 75 73 | 65 20 74 6f 20 70 72 6f |be of us|e to pro|
|00000130| 67 61 6d 6d 65 72 73 20 | 77 68 6f 20 77 61 6e 74 |gammers |who want|
|00000140| 20 74 6f 20 61 64 61 70 | 74 20 74 68 65 69 72 20 | to adap|t their |
|00000150| 6f 77 6e 0d 0a 2f 2f 20 | 73 65 72 76 65 72 20 75 |own..// |server u|
|00000160| 70 6c 69 6e 6b 73 2e 0d | 0a 2f 2f 0d 0a 2f 2f 20 |plinks..|.//..// |
|00000170| 55 64 70 53 65 72 76 65 | 72 55 70 6c 69 6e 6b 20 |UdpServe|rUplink |
|00000180| 73 65 6e 64 73 20 61 20 | 68 65 61 72 74 62 65 61 |sends a |heartbea|
|00000190| 74 20 74 6f 20 74 68 65 | 20 73 70 65 63 69 66 69 |t to the| specifi|
|000001a0| 65 64 20 6d 61 73 74 65 | 72 20 73 65 72 76 65 72 |ed maste|r server|
|000001b0| 0d 0a 2f 2f 20 65 76 65 | 72 79 20 66 69 76 65 20 |..// eve|ry five |
|000001c0| 6d 69 6e 75 74 65 73 2e | 20 20 54 68 65 20 68 65 |minutes.| The he|
|000001d0| 61 72 74 62 65 61 74 20 | 69 73 20 69 6e 20 74 68 |artbeat |is in th|
|000001e0| 65 20 66 6f 72 6d 3a 0d | 0a 2f 2f 20 20 20 20 5c |e form:.|.// \|
|000001f0| 68 65 61 72 74 62 65 61 | 74 5c 51 75 65 72 79 50 |heartbea|t\QueryP|
|00000200| 6f 72 74 5c 67 61 6d 65 | 6e 61 6d 65 5c 75 6e 72 |ort\game|name\unr|
|00000210| 65 61 6c 0d 0a 2f 2f 0d | 0a 2f 2f 20 46 75 6c 6c |eal..//.|.// Full|
|00000220| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 20 6f | documen|tation o|
|00000230| 6e 20 74 68 69 73 20 63 | 6c 61 73 73 20 69 73 20 |n this c|lass is |
|00000240| 61 76 61 69 6c 61 62 6c | 65 20 61 74 20 68 74 74 |availabl|e at htt|
|00000250| 70 3a 2f 2f 75 6e 72 65 | 61 6c 2e 65 70 69 63 67 |p://unre|al.epicg|
|00000260| 61 6d 65 73 2e 63 6f 6d | 2f 0d 0a 2f 2f 0d 0a 2f |ames.com|/..//../|
|00000270| 2f 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |/=======|========|
|00000280| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000290| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000002a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000002b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 0a |========|======..|
|000002c0| 63 6c 61 73 73 20 55 64 | 70 53 65 72 76 65 72 55 |class Ud|pServerU|
|000002d0| 70 6c 69 6e 6b 20 65 78 | 74 65 6e 64 73 20 55 64 |plink ex|tends Ud|
|000002e0| 70 4c 69 6e 6b 20 63 6f | 6e 66 69 67 3b 0d 0a 0d |pLink co|nfig;...|
|000002f0| 0a 2f 2f 20 4d 61 73 74 | 65 72 20 55 70 6c 69 6e |.// Mast|er Uplin|
|00000300| 6b 20 43 6f 6e 66 69 67 | 2e 0d 0a 76 61 72 28 29 |k Config|...var()|
|00000310| 20 63 6f 6e 66 69 67 20 | 62 6f 6f 6c 09 09 44 6f | config |bool..Do|
|00000320| 55 70 6c 69 6e 6b 3b 09 | 09 09 09 2f 2f 20 49 66 |Uplink;.|...// If|
|00000330| 20 74 72 75 65 2c 20 64 | 6f 20 74 68 65 20 75 70 | true, d|o the up|
|00000340| 6c 69 6e 6b 0d 0a 76 61 | 72 28 29 20 63 6f 6e 66 |link..va|r() conf|
|00000350| 69 67 20 69 6e 74 09 09 | 55 70 64 61 74 65 4d 69 |ig int..|UpdateMi|
|00000360| 6e 75 74 65 73 3b 09 09 | 09 2f 2f 20 50 65 72 69 |nutes;..|.// Peri|
|00000370| 6f 64 20 6f 66 20 75 70 | 64 61 74 65 20 28 69 6e |od of up|date (in|
|00000380| 20 6d 69 6e 75 74 65 73 | 29 0d 0a 76 61 72 28 29 | minutes|)..var()|
|00000390| 20 63 6f 6e 66 69 67 20 | 73 74 72 69 6e 67 20 20 | config |string |
|000003a0| 20 20 20 4d 61 73 74 65 | 72 53 65 72 76 65 72 41 | Maste|rServerA|
|000003b0| 64 64 72 65 73 73 3b 09 | 2f 2f 20 41 64 64 72 65 |ddress;.|// Addre|
|000003c0| 73 73 20 6f 66 20 74 68 | 65 20 6d 61 73 74 65 72 |ss of th|e master|
|000003d0| 20 73 65 72 76 65 72 0d | 0a 76 61 72 28 29 20 63 | server.|.var() c|
|000003e0| 6f 6e 66 69 67 20 69 6e | 74 09 09 4d 61 73 74 65 |onfig in|t..Maste|
|000003f0| 72 53 65 72 76 65 72 50 | 6f 72 74 3b 09 09 2f 2f |rServerP|ort;..//|
|00000400| 20 4f 70 74 69 6f 6e 61 | 6c 20 70 6f 72 74 20 74 | Optiona|l port t|
|00000410| 68 61 74 20 74 68 65 20 | 6d 61 73 74 65 72 20 73 |hat the |master s|
|00000420| 65 72 76 65 72 20 69 73 | 20 6c 69 73 74 65 6e 69 |erver is| listeni|
|00000430| 6e 67 20 6f 6e 0d 0a 76 | 61 72 28 29 20 63 6f 6e |ng on..v|ar() con|
|00000440| 66 69 67 20 69 6e 74 20 | 09 09 52 65 67 69 6f 6e |fig int |..Region|
|00000450| 3b 09 09 09 09 09 2f 2f | 20 52 65 67 69 6f 6e 20 |;.....//| Region |
|00000460| 6f 66 20 74 68 65 20 67 | 61 6d 65 20 73 65 72 76 |of the g|ame serv|
|00000470| 65 72 0d 0a 76 61 72 28 | 29 20 6e 61 6d 65 09 09 |er..var(|) name..|
|00000480| 09 09 54 61 72 67 65 74 | 51 75 65 72 79 4e 61 6d |..Target|QueryNam|
|00000490| 65 3b 09 09 2f 2f 20 4e | 61 6d 65 20 6f 66 20 74 |e;..// N|ame of t|
|000004a0| 68 65 20 71 75 65 72 79 | 20 73 65 72 76 65 72 20 |he query| server |
|000004b0| 6f 62 6a 65 63 74 20 74 | 6f 20 75 73 65 2e 0d 0a |object t|o use...|
|000004c0| 76 61 72 20 49 70 41 64 | 64 72 09 09 09 09 4d 61 |var IpAd|dr....Ma|
|000004d0| 73 74 65 72 53 65 72 76 | 65 72 49 70 41 64 64 72 |sterServ|erIpAddr|
|000004e0| 3b 09 09 2f 2f 20 4d 61 | 73 74 65 72 20 73 65 72 |;..// Ma|ster ser|
|000004f0| 76 65 72 27 73 20 61 64 | 64 72 65 73 73 2e 0d 0a |ver's ad|dress...|
|00000500| 76 61 72 20 73 74 72 69 | 6e 67 09 09 20 20 20 20 |var stri|ng.. |
|00000510| 20 20 20 20 48 65 61 72 | 74 62 65 61 74 4d 65 73 | Hear|tbeatMes|
|00000520| 73 61 67 65 3b 09 09 2f | 2f 20 54 68 65 20 6d 65 |sage;../|/ The me|
|00000530| 73 73 61 67 65 20 74 68 | 61 74 20 69 73 20 73 65 |ssage th|at is se|
|00000540| 6e 74 20 74 6f 20 74 68 | 65 20 6d 61 73 74 65 72 |nt to th|e master|
|00000550| 20 73 65 72 76 65 72 2e | 0d 0a 76 61 72 20 55 64 | server.|..var Ud|
|00000560| 70 53 65 72 76 65 72 51 | 75 65 72 79 20 20 20 20 |pServerQ|uery |
|00000570| 20 20 51 75 65 72 79 3b | 09 09 09 09 09 2f 2f 20 | Query;|.....// |
|00000580| 54 68 65 20 71 75 65 72 | 79 20 6f 62 6a 65 63 74 |The quer|y object|
|00000590| 2e 0d 0a 76 61 72 20 69 | 6e 74 09 09 09 09 20 20 |...var i|nt.... |
|000005a0| 20 20 43 75 72 72 65 6e | 74 51 75 65 72 79 4e 75 | Curren|tQueryNu|
|000005b0| 6d 3b 09 09 2f 2f 20 51 | 75 65 72 79 20 49 44 20 |m;..// Q|uery ID |
|000005c0| 4e 75 6d 62 65 72 2e 0d | 0a 0d 0a 2f 2f 20 49 6e |Number..|...// In|
|000005d0| 69 74 69 61 6c 69 7a 65 | 2e 0d 0a 66 75 6e 63 74 |itialize|...funct|
|000005e0| 69 6f 6e 20 50 72 65 42 | 65 67 69 6e 50 6c 61 79 |ion PreB|eginPlay|
|000005f0| 28 29 0d 0a 7b 0d 0a 09 | 2f 2f 20 49 66 20 6d 61 |()..{...|// If ma|
|00000600| 73 74 65 72 20 73 65 72 | 76 65 72 20 75 70 6c 69 |ster ser|ver upli|
|00000610| 6e 6b 20 69 73 6e 27 74 | 20 77 61 6e 74 65 64 2c |nk isn't| wanted,|
|00000620| 20 65 78 69 74 2e 0d 0a | 09 69 66 28 20 21 44 6f | exit...|.if( !Do|
|00000630| 55 70 6c 69 6e 6b 20 29 | 0d 0a 09 7b 0d 0a 09 09 |Uplink )|...{....|
|00000640| 4c 6f 67 28 22 44 6f 55 | 70 6c 69 6e 6b 20 69 73 |Log("DoU|plink is|
|00000650| 20 6e 6f 74 20 73 65 74 | 2e 20 20 4e 6f 74 20 63 | not set|. Not c|
|00000660| 6f 6e 6e 65 63 74 69 6e | 67 20 74 6f 20 4d 61 73 |onnectin|g to Mas|
|00000670| 74 65 72 20 53 65 72 76 | 65 72 2e 22 29 3b 0d 0a |ter Serv|er.");..|
|00000680| 09 09 72 65 74 75 72 6e | 3b 0d 0a 09 7d 0d 0a 0d |..return|;...}...|
|00000690| 0a 09 69 66 28 20 4c 65 | 76 65 6c 2e 4e 65 74 4d |..if( Le|vel.NetM|
|000006a0| 6f 64 65 20 3d 3d 20 4e | 4d 5f 4c 69 73 74 65 6e |ode == N|M_Listen|
|000006b0| 53 65 72 76 65 72 20 29 | 0d 0a 09 7b 0d 0a 09 09 |Server )|...{....|
|000006c0| 4c 6f 67 28 22 54 68 69 | 73 20 69 73 20 61 20 4c |Log("Thi|s is a L|
|000006d0| 69 73 74 65 6e 20 73 65 | 72 76 65 72 2e 20 20 4e |isten se|rver. N|
|000006e0| 6f 74 20 63 6f 6e 6e 65 | 63 74 69 6e 67 20 74 6f |ot conne|cting to|
|000006f0| 20 4d 61 73 74 65 72 20 | 53 65 72 76 65 72 2e 22 | Master |Server."|
|00000700| 29 3b 0d 0a 09 09 72 65 | 74 75 72 6e 3b 0d 0a 09 |);....re|turn;...|
|00000710| 7d 0d 0a 0d 0a 09 2f 2f | 20 46 69 6e 64 20 61 20 |}.....//| Find a |
|00000720| 74 68 65 20 73 65 72 76 | 65 72 20 71 75 65 72 79 |the serv|er query|
|00000730| 20 68 61 6e 64 6c 65 72 | 2e 0d 0a 09 66 6f 72 65 | handler|....fore|
|00000740| 61 63 68 20 41 6c 6c 41 | 63 74 6f 72 73 28 63 6c |ach AllA|ctors(cl|
|00000750| 61 73 73 27 55 64 70 53 | 65 72 76 65 72 51 75 65 |ass'UdpS|erverQue|
|00000760| 72 79 27 2c 20 51 75 65 | 72 79 2c 20 54 61 72 67 |ry', Que|ry, Targ|
|00000770| 65 74 51 75 65 72 79 4e | 61 6d 65 29 0d 0a 09 09 |etQueryN|ame)....|
|00000780| 62 72 65 61 6b 3b 0d 0a | 0d 0a 09 69 66 28 20 51 |break;..|...if( Q|
|00000790| 75 65 72 79 3d 3d 4e 6f | 6e 65 20 29 0d 0a 09 7b |uery==No|ne )...{|
|000007a0| 0d 0a 09 09 4c 6f 67 28 | 22 55 64 70 53 65 72 76 |....Log(|"UdpServ|
|000007b0| 65 72 55 70 6c 69 6e 6b | 3a 20 43 6f 75 6c 64 20 |erUplink|: Could |
|000007c0| 6e 6f 74 20 66 69 6e 64 | 20 61 20 55 64 70 53 65 |not find| a UdpSe|
|000007d0| 72 76 65 72 51 75 65 72 | 79 20 6f 62 6a 65 63 74 |rverQuer|y object|
|000007e0| 2c 20 61 62 6f 72 74 69 | 6e 67 2e 22 29 3b 0d 0a |, aborti|ng.");..|
|000007f0| 09 09 72 65 74 75 72 6e | 3b 0d 0a 09 7d 0d 0a 0d |..return|;...}...|
|00000800| 0a 09 2f 2f 20 53 65 74 | 20 68 65 61 72 74 62 65 |..// Set| heartbe|
|00000810| 61 74 20 6d 65 73 73 61 | 67 65 2e 0d 0a 09 48 65 |at messa|ge....He|
|00000820| 61 72 74 62 65 61 74 4d | 65 73 73 61 67 65 20 3d |artbeatM|essage =|
|00000830| 20 22 5c 5c 68 65 61 72 | 74 62 65 61 74 5c 5c 22 | "\\hear|tbeat\\"|
|00000840| 24 51 75 65 72 79 2e 50 | 6f 72 74 24 22 5c 5c 67 |$Query.P|ort$"\\g|
|00000850| 61 6d 65 6e 61 6d 65 5c | 5c 22 24 51 75 65 72 79 |amename\|\"$Query|
|00000860| 2e 47 61 6d 65 4e 61 6d | 65 3b 0d 0a 0d 0a 09 2f |.GameNam|e;...../|
|00000870| 2f 20 53 65 74 20 74 68 | 65 20 50 6f 72 74 2e 0d |/ Set th|e Port..|
|00000880| 0a 09 4d 61 73 74 65 72 | 53 65 72 76 65 72 49 70 |..Master|ServerIp|
|00000890| 41 64 64 72 2e 50 6f 72 | 74 20 3d 20 4d 61 73 74 |Addr.Por|t = Mast|
|000008a0| 65 72 53 65 72 76 65 72 | 50 6f 72 74 3b 0d 0a 0d |erServer|Port;...|
|000008b0| 0a 09 2f 2f 20 52 65 73 | 6f 6c 76 65 20 74 68 65 |..// Res|olve the|
|000008c0| 20 41 64 64 72 65 73 73 | 2e 0d 0a 09 69 66 28 20 | Address|....if( |
|000008d0| 4d 61 73 74 65 72 53 65 | 72 76 65 72 41 64 64 72 |MasterSe|rverAddr|
|000008e0| 65 73 73 3d 3d 22 22 20 | 29 0d 0a 09 09 4d 61 73 |ess=="" |)....Mas|
|000008f0| 74 65 72 53 65 72 76 65 | 72 41 64 64 72 65 73 73 |terServe|rAddress|
|00000900| 20 3d 20 22 6d 61 73 74 | 65 72 22 24 52 65 67 69 | = "mast|er"$Regi|
|00000910| 6f 6e 24 22 2e 67 61 6d | 65 73 70 79 2e 63 6f 6d |on$".gam|espy.com|
|00000920| 22 3b 0d 0a 09 52 65 73 | 6f 6c 76 65 28 20 4d 61 |";...Res|olve( Ma|
|00000930| 73 74 65 72 53 65 72 76 | 65 72 41 64 64 72 65 73 |sterServ|erAddres|
|00000940| 73 20 29 3b 0d 0a 7d 0d | 0a 0d 0a 2f 2f 20 57 68 |s );..}.|...// Wh|
|00000950| 65 6e 20 6d 61 73 74 65 | 72 20 73 65 72 76 65 72 |en maste|r server|
|00000960| 20 61 64 64 72 65 73 73 | 20 69 73 20 72 65 73 6f | address| is reso|
|00000970| 6c 76 65 64 2e 0d 0a 66 | 75 6e 63 74 69 6f 6e 20 |lved...f|unction |
|00000980| 52 65 73 6f 6c 76 65 64 | 28 20 49 70 41 64 64 72 |Resolved|( IpAddr|
|00000990| 20 41 64 64 72 20 29 0d | 0a 7b 0d 0a 09 6c 6f 63 | Addr ).|.{...loc|
|000009a0| 61 6c 20 62 6f 6f 6c 20 | 52 65 73 75 6c 74 3b 0d |al bool |Result;.|
|000009b0| 0a 09 6c 6f 63 61 6c 20 | 69 6e 74 20 55 70 6c 69 |..local |int Upli|
|000009c0| 6e 6b 50 6f 72 74 3b 0d | 0a 0d 0a 09 2f 2f 20 53 |nkPort;.|....// S|
|000009d0| 65 74 20 74 68 65 20 61 | 64 64 72 65 73 73 0d 0a |et the a|ddress..|
|000009e0| 09 4d 61 73 74 65 72 53 | 65 72 76 65 72 49 70 41 |.MasterS|erverIpA|
|000009f0| 64 64 72 2e 41 64 64 72 | 20 3d 20 41 64 64 72 2e |ddr.Addr| = Addr.|
|00000a00| 41 64 64 72 3b 0d 0a 0d | 0a 09 2f 2f 20 48 61 6e |Addr;...|..// Han|
|00000a10| 64 6c 65 20 66 61 69 6c | 75 72 65 2e 0d 0a 09 69 |dle fail|ure....i|
|00000a20| 66 28 20 4d 61 73 74 65 | 72 53 65 72 76 65 72 49 |f( Maste|rServerI|
|00000a30| 70 41 64 64 72 2e 41 64 | 64 72 20 3d 3d 20 30 20 |pAddr.Ad|dr == 0 |
|00000a40| 29 0d 0a 09 7b 0d 0a 09 | 09 4c 6f 67 28 22 55 64 |)...{...|.Log("Ud|
|00000a50| 70 53 65 72 76 65 72 55 | 70 6c 69 6e 6b 3a 20 49 |pServerU|plink: I|
|00000a60| 6e 76 61 6c 69 64 20 6d | 61 73 74 65 72 20 73 65 |nvalid m|aster se|
|00000a70| 72 76 65 72 20 61 64 64 | 72 65 73 73 2c 20 61 62 |rver add|ress, ab|
|00000a80| 6f 72 74 69 6e 67 2e 22 | 29 3b 0d 0a 09 09 72 65 |orting."|);....re|
|00000a90| 74 75 72 6e 3b 0d 0a 09 | 7d 0d 0a 0d 0a 09 2f 2f |turn;...|}.....//|
|00000aa0| 20 44 69 73 70 6c 61 79 | 20 73 75 63 63 65 73 73 | Display| success|
|00000ab0| 20 6d 65 73 73 61 67 65 | 2e 0d 0a 09 4c 6f 67 28 | message|....Log(|
|00000ac0| 22 55 64 70 53 65 72 76 | 65 72 55 70 6c 69 6e 6b |"UdpServ|erUplink|
|00000ad0| 3a 20 4d 61 73 74 65 72 | 20 53 65 72 76 65 72 20 |: Master| Server |
|00000ae0| 69 73 20 22 24 4d 61 73 | 74 65 72 53 65 72 76 65 |is "$Mas|terServe|
|00000af0| 72 41 64 64 72 65 73 73 | 24 22 3a 22 24 4d 61 73 |rAddress|$":"$Mas|
|00000b00| 74 65 72 53 65 72 76 65 | 72 49 70 41 64 64 72 2e |terServe|rIpAddr.|
|00000b10| 50 6f 72 74 29 3b 0d 0a | 09 0d 0a 09 2f 2f 20 42 |Port);..|....// B|
|00000b20| 69 6e 64 20 74 68 65 20 | 6c 6f 63 61 6c 20 70 6f |ind the |local po|
|00000b30| 72 74 2e 0d 0a 09 55 70 | 6c 69 6e 6b 50 6f 72 74 |rt....Up|linkPort|
|00000b40| 20 3d 20 51 75 65 72 79 | 2e 50 6f 72 74 20 2b 20 | = Query|.Port + |
|00000b50| 31 3b 0d 0a 09 69 66 28 | 20 42 69 6e 64 50 6f 72 |1;...if(| BindPor|
|00000b60| 74 28 55 70 6c 69 6e 6b | 50 6f 72 74 2c 20 74 72 |t(Uplink|Port, tr|
|00000b70| 75 65 29 20 3d 3d 20 30 | 20 29 0d 0a 09 7b 0d 0a |ue) == 0| )...{..|
|00000b80| 09 09 4c 6f 67 28 20 22 | 55 64 70 53 65 72 76 65 |..Log( "|UdpServe|
|00000b90| 72 55 70 6c 69 6e 6b 3a | 20 45 72 72 6f 72 20 62 |rUplink:| Error b|
|00000ba0| 69 6e 64 69 6e 67 20 70 | 6f 72 74 2c 20 61 62 6f |inding p|ort, abo|
|00000bb0| 72 74 69 6e 67 2e 22 20 | 29 3b 0d 0a 09 09 72 65 |rting." |);....re|
|00000bc0| 74 75 72 6e 3b 0d 0a 09 | 7d 0d 0a 09 4c 6f 67 28 |turn;...|}...Log(|
|00000bd0| 22 55 64 70 53 65 72 76 | 65 72 55 70 6c 69 6e 6b |"UdpServ|erUplink|
|00000be0| 3a 20 50 6f 72 74 20 22 | 24 55 70 6c 69 6e 6b 50 |: Port "|$UplinkP|
|00000bf0| 6f 72 74 24 22 20 73 75 | 63 63 65 73 73 66 75 6c |ort$" su|ccessful|
|00000c00| 6c 79 20 62 6f 75 6e 64 | 2e 22 29 3b 0d 0a 0d 0a |ly bound|.");....|
|00000c10| 09 2f 2f 20 53 74 61 72 | 74 20 74 72 61 6e 73 6d |.// Star|t transm|
|00000c20| 69 74 74 69 6e 67 2e 0d | 0a 09 52 65 73 75 6d 65 |itting..|..Resume|
|00000c30| 28 29 3b 0d 0a 7d 0d 0a | 0d 0a 2f 2f 20 48 6f 73 |();..}..|..// Hos|
|00000c40| 74 20 72 65 73 6f 6c 75 | 74 69 6f 6e 20 66 61 69 |t resolu|tion fai|
|00000c50| 6c 75 65 2e 0d 0a 66 75 | 6e 63 74 69 6f 6e 20 52 |lue...fu|nction R|
|00000c60| 65 73 6f 6c 76 65 46 61 | 69 6c 65 64 28 29 0d 0a |esolveFa|iled()..|
|00000c70| 7b 0d 0a 09 4c 6f 67 28 | 22 55 64 70 53 65 72 76 |{...Log(|"UdpServ|
|00000c80| 65 72 55 70 6c 69 6e 6b | 3a 20 46 61 69 6c 65 64 |erUplink|: Failed|
|00000c90| 20 74 6f 20 72 65 73 6f | 6c 76 65 20 6d 61 73 74 | to reso|lve mast|
|00000ca0| 65 72 20 73 65 72 76 65 | 72 20 61 64 64 72 65 73 |er serve|r addres|
|00000cb0| 73 2c 20 61 62 6f 72 74 | 69 6e 67 2e 22 29 3b 0d |s, abort|ing.");.|
|00000cc0| 0a 7d 0d 0a 0d 0a 2f 2f | 20 4e 6f 74 69 66 79 20 |.}....//| Notify |
|00000cd0| 74 68 65 20 4d 61 73 74 | 65 72 53 65 72 76 65 72 |the Mast|erServer|
|00000ce0| 20 77 65 20 65 78 69 73 | 74 2e 0d 0a 66 75 6e 63 | we exis|t...func|
|00000cf0| 74 69 6f 6e 20 54 69 6d | 65 72 28 29 0d 0a 7b 0d |tion Tim|er()..{.|
|00000d00| 0a 09 6c 6f 63 61 6c 20 | 62 6f 6f 6c 20 52 65 73 |..local |bool Res|
|00000d10| 75 6c 74 3b 0d 0a 0d 0a | 09 52 65 73 75 6c 74 20 |ult;....|.Result |
|00000d20| 3d 20 53 65 6e 64 54 65 | 78 74 28 20 4d 61 73 74 |= SendTe|xt( Mast|
|00000d30| 65 72 53 65 72 76 65 72 | 49 70 41 64 64 72 2c 20 |erServer|IpAddr, |
|00000d40| 48 65 61 72 74 62 65 61 | 74 4d 65 73 73 61 67 65 |Heartbea|tMessage|
|00000d50| 20 29 3b 0d 0a 09 69 66 | 20 28 20 21 52 65 73 75 | );...if| ( !Resu|
|00000d60| 6c 74 20 29 0d 0a 09 09 | 4c 6f 67 28 20 22 46 61 |lt )....|Log( "Fa|
|00000d70| 69 6c 65 64 20 74 6f 20 | 73 65 6e 64 20 68 65 61 |iled to |send hea|
|00000d80| 72 74 62 65 61 74 20 74 | 6f 20 6d 61 73 74 65 72 |rtbeat t|o master|
|00000d90| 20 73 65 72 76 65 72 2e | 22 29 3b 0d 0a 7d 0d 0a | server.|");..}..|
|00000da0| 0d 0a 2f 2f 20 53 74 6f | 70 20 74 68 65 20 75 70 |..// Sto|p the up|
|00000db0| 6c 69 6e 6b 2e 0d 0a 66 | 75 6e 63 74 69 6f 6e 20 |link...f|unction |
|00000dc0| 48 61 6c 74 28 29 0d 0a | 7b 0d 0a 09 53 65 74 54 |Halt()..|{...SetT|
|00000dd0| 69 6d 65 72 28 30 2e 30 | 2c 20 66 61 6c 73 65 29 |imer(0.0|, false)|
|00000de0| 3b 0d 0a 7d 0d 0a 0d 0a | 2f 2f 20 52 65 73 75 6d |;..}....|// Resum|
|00000df0| 65 20 74 68 65 20 75 70 | 6c 69 6e 6b 2e 0d 0a 66 |e the up|link...f|
|00000e00| 75 6e 63 74 69 6f 6e 20 | 52 65 73 75 6d 65 28 29 |unction |Resume()|
|00000e10| 0d 0a 7b 0d 0a 09 53 65 | 74 54 69 6d 65 72 28 55 |..{...Se|tTimer(U|
|00000e20| 70 64 61 74 65 4d 69 6e | 75 74 65 73 20 2a 20 36 |pdateMin|utes * 6|
|00000e30| 30 2c 20 74 72 75 65 29 | 3b 0d 0a 09 54 69 6d 65 |0, true)|;...Time|
|00000e40| 72 28 29 3b 0d 0a 7d 0d | 0a 0d 0a 2f 2f 20 52 65 |r();..}.|...// Re|
|00000e50| 63 65 69 76 65 64 20 61 | 20 71 75 65 72 79 20 72 |ceived a| query r|
|00000e60| 65 71 75 65 73 74 2e 0d | 0a 65 76 65 6e 74 20 52 |equest..|.event R|
|00000e70| 65 63 65 69 76 65 64 54 | 65 78 74 28 20 49 70 41 |eceivedT|ext( IpA|
|00000e80| 64 64 72 20 41 64 64 72 | 2c 20 73 74 72 69 6e 67 |ddr Addr|, string|
|00000e90| 20 54 65 78 74 20 29 0d | 0a 7b 0d 0a 09 6c 6f 63 | Text ).|.{...loc|
|00000ea0| 61 6c 20 73 74 72 69 6e | 67 20 51 75 65 72 79 3b |al strin|g Query;|
|00000eb0| 0d 0a 09 6c 6f 63 61 6c | 20 62 6f 6f 6c 20 51 75 |...local| bool Qu|
|00000ec0| 65 72 79 52 65 6d 61 69 | 6e 69 6e 67 3b 0d 0a 09 |eryRemai|ning;...|
|00000ed0| 6c 6f 63 61 6c 20 69 6e | 74 20 20 51 75 65 72 79 |local in|t Query|
|00000ee0| 4e 75 6d 2c 20 50 61 63 | 6b 65 74 4e 75 6d 3b 0d |Num, Pac|ketNum;.|
|00000ef0| 0a 0d 0a 09 2f 2f 20 41 | 73 73 69 67 6e 20 74 68 |....// A|ssign th|
|00000f00| 69 73 20 70 61 63 6b 65 | 74 20 61 20 75 6e 69 71 |is packe|t a uniq|
|00000f10| 75 65 20 76 61 6c 75 65 | 20 66 72 6f 6d 20 31 20 |ue value| from 1 |
|00000f20| 74 6f 20 31 30 30 0d 0a | 09 43 75 72 72 65 6e 74 |to 100..|.Current|
|00000f30| 51 75 65 72 79 4e 75 6d | 2b 2b 3b 0d 0a 09 69 66 |QueryNum|++;...if|
|00000f40| 20 28 43 75 72 72 65 6e | 74 51 75 65 72 79 4e 75 | (Curren|tQueryNu|
|00000f50| 6d 20 3e 20 31 30 30 29 | 0d 0a 09 09 43 75 72 72 |m > 100)|....Curr|
|00000f60| 65 6e 74 51 75 65 72 79 | 4e 75 6d 20 3d 20 31 3b |entQuery|Num = 1;|
|00000f70| 0d 0a 09 51 75 65 72 79 | 4e 75 6d 20 3d 20 43 75 |...Query|Num = Cu|
|00000f80| 72 72 65 6e 74 51 75 65 | 72 79 4e 75 6d 3b 0d 0a |rrentQue|ryNum;..|
|00000f90| 0d 0a 09 51 75 65 72 79 | 20 3d 20 54 65 78 74 3b |...Query| = Text;|
|00000fa0| 0d 0a 09 69 66 20 28 51 | 75 65 72 79 20 3d 3d 20 |...if (Q|uery == |
|00000fb0| 22 22 29 09 09 2f 2f 20 | 49 66 20 74 68 65 20 73 |"")..// |If the s|
|00000fc0| 74 72 69 6e 67 20 69 73 | 20 65 6d 70 74 79 2c 20 |tring is| empty, |
|00000fd0| 64 6f 6e 27 74 20 70 61 | 72 73 65 20 69 74 0d 0a |don't pa|rse it..|
|00000fe0| 09 09 51 75 65 72 79 52 | 65 6d 61 69 6e 69 6e 67 |..QueryR|emaining|
|00000ff0| 20 3d 20 66 61 6c 73 65 | 3b 0d 0a 09 65 6c 73 65 | = false|;...else|
|00001000| 0d 0a 09 09 51 75 65 72 | 79 52 65 6d 61 69 6e 69 |....Quer|yRemaini|
|00001010| 6e 67 20 3d 20 74 72 75 | 65 3b 0d 0a 09 0d 0a 09 |ng = tru|e;......|
|00001020| 77 68 69 6c 65 20 28 51 | 75 65 72 79 52 65 6d 61 |while (Q|ueryRema|
|00001030| 69 6e 69 6e 67 29 20 7b | 0d 0a 09 09 51 75 65 72 |ining) {|....Quer|
|00001040| 79 20 3d 20 50 61 72 73 | 65 51 75 65 72 79 28 41 |y = Pars|eQuery(A|
|00001050| 64 64 72 2c 20 51 75 65 | 72 79 2c 20 51 75 65 72 |ddr, Que|ry, Quer|
|00001060| 79 4e 75 6d 2c 20 50 61 | 63 6b 65 74 4e 75 6d 29 |yNum, Pa|cketNum)|
|00001070| 3b 0d 0a 09 09 69 66 20 | 28 51 75 65 72 79 20 3d |;....if |(Query =|
|00001080| 3d 20 22 22 29 0d 0a 09 | 09 09 51 75 65 72 79 52 |= "")...|..QueryR|
|00001090| 65 6d 61 69 6e 69 6e 67 | 20 3d 20 66 61 6c 73 65 |emaining| = false|
|000010a0| 3b 0d 0a 09 09 65 6c 73 | 65 0d 0a 09 09 09 51 75 |;....els|e.....Qu|
|000010b0| 65 72 79 52 65 6d 61 69 | 6e 69 6e 67 20 3d 20 74 |eryRemai|ning = t|
|000010c0| 72 75 65 3b 0d 0a 09 7d | 0d 0a 7d 0d 0a 0d 0a 66 |rue;...}|..}....f|
|000010d0| 75 6e 63 74 69 6f 6e 20 | 62 6f 6f 6c 20 50 61 72 |unction |bool Par|
|000010e0| 73 65 4e 65 78 74 51 75 | 65 72 79 28 20 73 74 72 |seNextQu|ery( str|
|000010f0| 69 6e 67 20 51 75 65 72 | 79 2c 20 6f 75 74 20 73 |ing Quer|y, out s|
|00001100| 74 72 69 6e 67 20 51 75 | 65 72 79 54 79 70 65 2c |tring Qu|eryType,|
|00001110| 20 6f 75 74 20 73 74 72 | 69 6e 67 20 51 75 65 72 | out str|ing Quer|
|00001120| 79 56 61 6c 75 65 2c 20 | 6f 75 74 20 73 74 72 69 |yValue, |out stri|
|00001130| 6e 67 20 51 75 65 72 79 | 52 65 73 74 2c 20 6f 75 |ng Query|Rest, ou|
|00001140| 74 20 73 74 72 69 6e 67 | 20 46 69 6e 61 6c 50 61 |t string| FinalPa|
|00001150| 63 6b 65 74 20 29 0d 0a | 7b 0d 0a 09 6c 6f 63 61 |cket )..|{...loca|
|00001160| 6c 20 73 74 72 69 6e 67 | 20 54 65 6d 70 51 75 65 |l string| TempQue|
|00001170| 72 79 3b 0d 0a 09 6c 6f | 63 61 6c 20 69 6e 74 20 |ry;...lo|cal int |
|00001180| 43 6c 6f 73 69 6e 67 53 | 6c 61 73 68 3b 0d 0a 0d |ClosingS|lash;...|
|00001190| 0a 09 69 66 20 28 51 75 | 65 72 79 20 3d 3d 20 22 |..if (Qu|ery == "|
|000011a0| 22 29 0d 0a 09 09 72 65 | 74 75 72 6e 20 66 61 6c |")....re|turn fal|
|000011b0| 73 65 3b 0d 0a 0d 0a 09 | 2f 2f 20 51 75 65 72 79 |se;.....|// Query|
|000011c0| 20 73 68 6f 75 6c 64 20 | 62 65 3a 0d 0a 09 2f 2f | should |be:...//|
|000011d0| 20 20 20 5c 5b 74 79 70 | 65 5d 5c 3c 76 61 6c 75 | \[typ|e]\<valu|
|000011e0| 65 3e 0d 0a 09 69 66 20 | 28 4c 65 66 74 28 51 75 |e>...if |(Left(Qu|
|000011f0| 65 72 79 2c 20 31 29 20 | 3d 3d 20 22 5c 5c 22 29 |ery, 1) |== "\\")|
|00001200| 0d 0a 09 7b 0d 0a 09 09 | 2f 2f 20 43 68 65 63 6b |...{....|// Check|
|00001210| 20 74 6f 20 73 65 65 20 | 69 66 20 63 6c 6f 73 65 | to see |if close|
|00001220| 64 2e 0d 0a 09 09 43 6c | 6f 73 69 6e 67 53 6c 61 |d.....Cl|osingSla|
|00001230| 73 68 20 3d 20 49 6e 53 | 74 72 28 52 69 67 68 74 |sh = InS|tr(Right|
|00001240| 28 51 75 65 72 79 2c 20 | 4c 65 6e 28 51 75 65 72 |(Query, |Len(Quer|
|00001250| 79 29 2d 31 29 2c 20 22 | 5c 5c 22 29 3b 0d 0a 09 |y)-1), "|\\");...|
|00001260| 09 69 66 20 28 43 6c 6f | 73 69 6e 67 53 6c 61 73 |.if (Clo|singSlas|
|00001270| 68 20 3d 3d 20 30 29 0d | 0a 09 09 09 72 65 74 75 |h == 0).|....retu|
|00001280| 72 6e 20 66 61 6c 73 65 | 3b 0d 0a 0d 0a 09 09 54 |rn false|;......T|
|00001290| 65 6d 70 51 75 65 72 79 | 20 3d 20 51 75 65 72 79 |empQuery| = Query|
|000012a0| 3b 0d 0a 0d 0a 09 09 2f | 2f 20 51 75 65 72 79 20 |;....../|/ Query |
|000012b0| 6c 6f 6f 6b 73 20 6c 69 | 6b 65 3a 0d 0a 09 09 2f |looks li|ke:..../|
|000012c0| 2f 20 20 5c 5b 74 79 70 | 65 5d 5c 0d 0a 09 09 51 |/ \[typ|e]\....Q|
|000012d0| 75 65 72 79 54 79 70 65 | 20 3d 20 52 69 67 68 74 |ueryType| = Right|
|000012e0| 28 51 75 65 72 79 2c 20 | 4c 65 6e 28 51 75 65 72 |(Query, |Len(Quer|
|000012f0| 79 29 2d 31 29 3b 0d 0a | 09 09 51 75 65 72 79 54 |y)-1);..|..QueryT|
|00001300| 79 70 65 20 3d 20 4c 65 | 66 74 28 51 75 65 72 79 |ype = Le|ft(Query|
|00001310| 54 79 70 65 2c 20 43 6c | 6f 73 69 6e 67 53 6c 61 |Type, Cl|osingSla|
|00001320| 73 68 29 3b 0d 0a 0d 0a | 09 09 51 75 65 72 79 52 |sh);....|..QueryR|
|00001330| 65 73 74 20 3d 20 52 69 | 67 68 74 28 51 75 65 72 |est = Ri|ght(Quer|
|00001340| 79 2c 20 4c 65 6e 28 51 | 75 65 72 79 29 20 2d 20 |y, Len(Q|uery) - |
|00001350| 28 4c 65 6e 28 51 75 65 | 72 79 54 79 70 65 29 20 |(Len(Que|ryType) |
|00001360| 2b 20 32 29 29 3b 0d 0a | 0d 0a 09 09 69 66 20 28 |+ 2));..|....if (|
|00001370| 28 51 75 65 72 79 52 65 | 73 74 20 3d 3d 20 22 22 |(QueryRe|st == ""|
|00001380| 29 20 7c 7c 20 28 4c 65 | 6e 28 51 75 65 72 79 52 |) || (Le|n(QueryR|
|00001390| 65 73 74 29 20 3d 3d 20 | 31 29 29 0d 0a 09 09 7b |est) == |1))....{|
|000013a0| 0d 0a 09 09 09 46 69 6e | 61 6c 50 61 63 6b 65 74 |.....Fin|alPacket|
|000013b0| 20 3d 20 22 66 69 6e 61 | 6c 22 3b 0d 0a 09 09 09 | = "fina|l";.....|
|000013c0| 72 65 74 75 72 6e 20 74 | 72 75 65 3b 0d 0a 09 09 |return t|rue;....|
|000013d0| 7d 20 65 6c 73 65 20 69 | 66 20 28 4c 65 66 74 28 |} else i|f (Left(|
|000013e0| 51 75 65 72 79 52 65 73 | 74 2c 20 31 29 20 3d 3d |QueryRes|t, 1) ==|
|000013f0| 20 22 5c 5c 22 29 0d 0a | 09 09 09 72 65 74 75 72 | "\\")..|...retur|
|00001400| 6e 20 74 72 75 65 3b 09 | 2f 2f 20 5c 74 79 70 65 |n true;.|// \type|
|00001410| 5c 5c 0d 0a 0d 0a 09 09 | 2f 2f 20 51 75 65 72 79 |\\......|// Query|
|00001420| 20 6c 6f 6f 6b 73 20 6c | 69 6b 65 3a 0d 0a 09 09 | looks l|ike:....|
|00001430| 2f 2f 20 20 5c 74 79 70 | 65 5c 76 61 6c 75 65 0d |// \typ|e\value.|
|00001440| 0a 09 09 43 6c 6f 73 69 | 6e 67 53 6c 61 73 68 20 |...Closi|ngSlash |
|00001450| 3d 20 49 6e 53 74 72 28 | 51 75 65 72 79 52 65 73 |= InStr(|QueryRes|
|00001460| 74 2c 20 22 5c 5c 22 29 | 3b 0d 0a 09 09 69 66 20 |t, "\\")|;....if |
|00001470| 28 43 6c 6f 73 69 6e 67 | 53 6c 61 73 68 20 3e 3d |(Closing|Slash >=|
|00001480| 20 30 29 0d 0a 09 09 09 | 51 75 65 72 79 56 61 6c | 0).....|QueryVal|
|00001490| 75 65 20 3d 20 4c 65 66 | 74 28 51 75 65 72 79 52 |ue = Lef|t(QueryR|
|000014a0| 65 73 74 2c 20 43 6c 6f | 73 69 6e 67 53 6c 61 73 |est, Clo|singSlas|
|000014b0| 68 29 3b 0d 0a 09 09 65 | 6c 73 65 0d 0a 09 09 09 |h);....e|lse.....|
|000014c0| 51 75 65 72 79 56 61 6c | 75 65 20 3d 20 51 75 65 |QueryVal|ue = Que|
|000014d0| 72 79 52 65 73 74 3b 0d | 0a 0d 0a 09 09 51 75 65 |ryRest;.|.....Que|
|000014e0| 72 79 52 65 73 74 20 3d | 20 52 69 67 68 74 28 51 |ryRest =| Right(Q|
|000014f0| 75 65 72 79 2c 20 4c 65 | 6e 28 51 75 65 72 79 29 |uery, Le|n(Query)|
|00001500| 20 2d 20 28 4c 65 6e 28 | 51 75 65 72 79 54 79 70 | - (Len(|QueryTyp|
|00001510| 65 29 20 2b 20 4c 65 6e | 28 51 75 65 72 79 56 61 |e) + Len|(QueryVa|
|00001520| 6c 75 65 29 20 2b 20 33 | 29 29 3b 0d 0a 09 09 69 |lue) + 3|));....i|
|00001530| 66 20 28 51 75 65 72 79 | 52 65 73 74 20 3d 3d 20 |f (Query|Rest == |
|00001540| 22 22 29 0d 0a 09 09 7b | 0d 0a 09 09 09 46 69 6e |"")....{|.....Fin|
|00001550| 61 6c 50 61 63 6b 65 74 | 20 3d 20 22 66 69 6e 61 |alPacket| = "fina|
|00001560| 6c 22 3b 0d 0a 09 09 09 | 72 65 74 75 72 6e 20 74 |l";.....|return t|
|00001570| 72 75 65 3b 0d 0a 09 09 | 7d 20 65 6c 73 65 0d 0a |rue;....|} else..|
|00001580| 09 09 09 72 65 74 75 72 | 6e 20 74 72 75 65 3b 0d |...retur|n true;.|
|00001590| 0a 09 7d 20 65 6c 73 65 | 20 7b 0d 0a 09 09 72 65 |..} else| {....re|
|000015a0| 74 75 72 6e 20 66 61 6c | 73 65 3b 0d 0a 09 7d 0d |turn fal|se;...}.|
|000015b0| 0a 7d 0d 0a 0d 0a 66 75 | 6e 63 74 69 6f 6e 20 73 |.}....fu|nction s|
|000015c0| 74 72 69 6e 67 20 50 61 | 72 73 65 51 75 65 72 79 |tring Pa|rseQuery|
|000015d0| 28 20 49 70 41 64 64 72 | 20 41 64 64 72 2c 20 63 |( IpAddr| Addr, c|
|000015e0| 6f 65 72 63 65 20 73 74 | 72 69 6e 67 20 51 75 65 |oerce st|ring Que|
|000015f0| 72 79 53 74 72 2c 20 69 | 6e 74 20 51 75 65 72 79 |ryStr, i|nt Query|
|00001600| 4e 75 6d 2c 20 6f 75 74 | 20 69 6e 74 20 50 61 63 |Num, out| int Pac|
|00001610| 6b 65 74 4e 75 6d 20 29 | 0d 0a 7b 0d 0a 09 6c 6f |ketNum )|..{...lo|
|00001620| 63 61 6c 20 73 74 72 69 | 6e 67 20 51 75 65 72 79 |cal stri|ng Query|
|00001630| 54 79 70 65 2c 20 51 75 | 65 72 79 56 61 6c 75 65 |Type, Qu|eryValue|
|00001640| 2c 20 51 75 65 72 79 52 | 65 73 74 2c 20 56 61 6c |, QueryR|est, Val|
|00001650| 69 64 61 74 69 6f 6e 53 | 74 72 69 6e 67 3b 0d 0a |idationS|tring;..|
|00001660| 09 6c 6f 63 61 6c 20 62 | 6f 6f 6c 20 52 65 73 75 |.local b|ool Resu|
|00001670| 6c 74 3b 0d 0a 09 6c 6f | 63 61 6c 20 73 74 72 69 |lt;...lo|cal stri|
|00001680| 6e 67 20 46 69 6e 61 6c | 50 61 63 6b 65 74 3b 0d |ng Final|Packet;.|
|00001690| 0a 09 0d 0a 09 52 65 73 | 75 6c 74 20 3d 20 50 61 |.....Res|ult = Pa|
|000016a0| 72 73 65 4e 65 78 74 51 | 75 65 72 79 28 51 75 65 |rseNextQ|uery(Que|
|000016b0| 72 79 53 74 72 2c 20 51 | 75 65 72 79 54 79 70 65 |ryStr, Q|ueryType|
|000016c0| 2c 20 51 75 65 72 79 56 | 61 6c 75 65 2c 20 51 75 |, QueryV|alue, Qu|
|000016d0| 65 72 79 52 65 73 74 2c | 20 46 69 6e 61 6c 50 61 |eryRest,| FinalPa|
|000016e0| 63 6b 65 74 29 3b 0d 0a | 09 69 66 28 20 21 52 65 |cket);..|.if( !Re|
|000016f0| 73 75 6c 74 20 29 0d 0a | 09 09 72 65 74 75 72 6e |sult )..|..return|
|00001700| 20 22 22 3b 0d 0a 0d 0a | 09 69 66 28 20 51 75 65 | "";....|.if( Que|
|00001710| 72 79 54 79 70 65 3d 3d | 22 62 61 73 69 63 22 20 |ryType==|"basic" |
|00001720| 29 0d 0a 09 7b 0d 0a 09 | 09 2f 2f 20 49 67 6e 6f |)...{...|.// Igno|
|00001730| 72 65 2e 0d 0a 09 09 52 | 65 73 75 6c 74 20 3d 20 |re.....R|esult = |
|00001740| 74 72 75 65 3b 0d 0a 09 | 7d 0d 0a 09 65 6c 73 65 |true;...|}...else|
|00001750| 20 69 66 28 20 51 75 65 | 72 79 54 79 70 65 3d 3d | if( Que|ryType==|
|00001760| 22 73 65 63 75 72 65 22 | 20 29 0d 0a 09 7b 0d 0a |"secure"| )...{..|
|00001770| 09 09 56 61 6c 69 64 61 | 74 69 6f 6e 53 74 72 69 |..Valida|tionStri|
|00001780| 6e 67 20 3d 20 22 5c 5c | 76 61 6c 69 64 61 74 65 |ng = "\\|validate|
|00001790| 5c 5c 22 24 56 61 6c 69 | 64 61 74 65 28 51 75 65 |\\"$Vali|date(Que|
|000017a0| 72 79 56 61 6c 75 65 2c | 20 51 75 65 72 79 2e 47 |ryValue,| Query.G|
|000017b0| 61 6d 65 4e 61 6d 65 29 | 3b 0d 0a 09 09 52 65 73 |ameName)|;....Res|
|000017c0| 75 6c 74 20 3d 20 53 65 | 6e 64 51 75 65 72 79 50 |ult = Se|ndQueryP|
|000017d0| 61 63 6b 65 74 28 41 64 | 64 72 2c 20 56 61 6c 69 |acket(Ad|dr, Vali|
|000017e0| 64 61 74 69 6f 6e 53 74 | 72 69 6e 67 2c 20 51 75 |dationSt|ring, Qu|
|000017f0| 65 72 79 4e 75 6d 2c 20 | 2b 2b 50 61 63 6b 65 74 |eryNum, |++Packet|
|00001800| 4e 75 6d 2c 20 46 69 6e | 61 6c 50 61 63 6b 65 74 |Num, Fin|alPacket|
|00001810| 29 3b 0d 0a 09 7d 0d 0a | 09 65 6c 73 65 0d 0a 09 |);...}..|.else...|
|00001820| 7b 0d 0a 09 09 4c 6f 67 | 28 22 55 64 70 53 65 72 |{....Log|("UdpSer|
|00001830| 76 65 72 51 75 65 72 79 | 3a 20 55 6e 6b 6e 6f 77 |verQuery|: Unknow|
|00001840| 6e 20 71 75 65 72 79 3a | 20 22 24 51 75 65 72 79 |n query:| "$Query|
|00001850| 54 79 70 65 29 3b 0d 0a | 09 7d 0d 0a 09 69 66 28 |Type);..|.}...if(|
|00001860| 20 21 52 65 73 75 6c 74 | 20 29 0d 0a 09 09 4c 6f | !Result| )....Lo|
|00001870| 67 28 22 55 64 70 53 65 | 72 76 65 72 51 75 65 72 |g("UdpSe|rverQuer|
|00001880| 79 3a 20 45 72 72 6f 72 | 20 72 65 73 70 6f 6e 64 |y: Error| respond|
|00001890| 69 6e 67 20 74 6f 20 71 | 75 65 72 79 2e 22 29 3b |ing to q|uery.");|
|000018a0| 0d 0a 09 72 65 74 75 72 | 6e 20 51 75 65 72 79 52 |...retur|n QueryR|
|000018b0| 65 73 74 3b 0d 0a 7d 0d | 0a 0d 0a 2f 2f 20 53 65 |est;..}.|...// Se|
|000018c0| 6e 64 51 75 65 72 79 50 | 61 63 6b 65 74 20 69 73 |ndQueryP|acket is|
|000018d0| 20 61 20 77 72 61 70 70 | 65 72 20 66 6f 72 20 53 | a wrapp|er for S|
|000018e0| 65 6e 64 54 65 78 74 20 | 74 68 61 74 20 61 6c 6c |endText |that all|
|000018f0| 6f 77 73 20 66 6f 72 20 | 70 61 63 6b 65 74 20 6e |ows for |packet n|
|00001900| 75 6d 62 65 72 69 6e 67 | 2e 0d 0a 66 75 6e 63 74 |umbering|...funct|
|00001910| 69 6f 6e 20 62 6f 6f 6c | 20 53 65 6e 64 51 75 65 |ion bool| SendQue|
|00001920| 72 79 50 61 63 6b 65 74 | 28 49 70 41 64 64 72 20 |ryPacket|(IpAddr |
|00001930| 41 64 64 72 2c 20 63 6f | 65 72 63 65 20 73 74 72 |Addr, co|erce str|
|00001940| 69 6e 67 20 53 65 6e 64 | 53 74 72 69 6e 67 2c 20 |ing Send|String, |
|00001950| 69 6e 74 20 51 75 65 72 | 79 4e 75 6d 2c 20 69 6e |int Quer|yNum, in|
|00001960| 74 20 50 61 63 6b 65 74 | 4e 75 6d 2c 20 73 74 72 |t Packet|Num, str|
|00001970| 69 6e 67 20 46 69 6e 61 | 6c 50 61 63 6b 65 74 29 |ing Fina|lPacket)|
|00001980| 0d 0a 7b 0d 0a 09 6c 6f | 63 61 6c 20 62 6f 6f 6c |..{...lo|cal bool|
|00001990| 20 52 65 73 75 6c 74 3b | 0d 0a 09 69 66 20 28 46 | Result;|...if (F|
|000019a0| 69 6e 61 6c 50 61 63 6b | 65 74 20 3d 3d 20 22 66 |inalPack|et == "f|
|000019b0| 69 6e 61 6c 22 29 20 7b | 0d 0a 09 09 53 65 6e 64 |inal") {|....Send|
|000019c0| 53 74 72 69 6e 67 20 3d | 20 53 65 6e 64 53 74 72 |String =| SendStr|
|000019d0| 69 6e 67 24 22 5c 5c 66 | 69 6e 61 6c 5c 5c 22 3b |ing$"\\f|inal\\";|
|000019e0| 0d 0a 09 7d 0d 0a 09 53 | 65 6e 64 53 74 72 69 6e |...}...S|endStrin|
|000019f0| 67 20 3d 20 53 65 6e 64 | 53 74 72 69 6e 67 24 22 |g = Send|String$"|
|00001a00| 5c 5c 71 75 65 72 79 69 | 64 5c 5c 22 24 51 75 65 |\\queryi|d\\"$Que|
|00001a10| 72 79 4e 75 6d 24 22 2e | 22 24 50 61 63 6b 65 74 |ryNum$".|"$Packet|
|00001a20| 4e 75 6d 3b 0d 0a 0d 0a | 09 52 65 73 75 6c 74 20 |Num;....|.Result |
|00001a30| 3d 20 53 65 6e 64 54 65 | 78 74 28 41 64 64 72 2c |= SendTe|xt(Addr,|
|00001a40| 20 53 65 6e 64 53 74 72 | 69 6e 67 29 3b 0d 0a 0d | SendStr|ing);...|
|00001a50| 0a 09 72 65 74 75 72 6e | 20 52 65 73 75 6c 74 3b |..return| Result;|
|00001a60| 0d 0a 7d 0d 0a 0d 0a 00 | |..}.....| |
+--------+-------------------------+-------------------------+--------+--------+